package domain.entities;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

import javax.persistence.*;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Set;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Created with IntelliJ IDEA.
 * User: Guillermo
 * Date: 12/09/12
 * Time: 11:10
 * To change this template use File | Settings | File Templates.
 */

@Entity
@Table(name = "protocolleveldocumentation", catalog = "bms")
public class ProtocolLevelDocumentation implements java.io.Serializable {


    private Integer id;
    private ProtocolLevelDocumentationCategory protocolLevelDocumentationCategory;
    private List<ProtocoloCompromisopais> protocoloCompromisopaises;
    private String description;
    private String version;
    private Date dated;
    private Date receivedBms;
    private boolean partOfInitialPackage;
    private Date sentToPrism;
    private Date confirmedPrism;
    private Date sampleIfcReviewForm;
    private Date sentToMoh;
    private Date approvalMoh;

    private Traductor traductor;
    private String translationBudget;
    private Date sentToTranslator;
    private Date translationReady ;
    private Date receivedFromTranslator;
    private String translatorRate;
    private String translatorRateComments;
    private Traductor traductorReviewer ;
    private String translationReviewBudget;
    private Date sentToTranslationReviewer;
    private Date translationRevisionReady;
    private Date receivedFromTranslationReviewer;
    private String translatorReviewRate;
    private String translatorReviewRateComments;
    private Date translationCertificate;
    private Date translationReviewForm ;



    public ProtocolLevelDocumentation() {
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "protocolinformation_category_id", nullable = false)
    public ProtocolLevelDocumentationCategory getProtocolLevelDocumentationCategory() {
        return protocolLevelDocumentationCategory;
    }

    public void setProtocolLevelDocumentationCategory(ProtocolLevelDocumentationCategory protocolLevelDocumentationCategory) {
        this.protocolLevelDocumentationCategory = protocolLevelDocumentationCategory;
    }

    @Column(name = "description", nullable = false)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }



    @Column(name = "version", nullable = false)
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "dated", length = 10)
    public Date getDated() {
        return dated;
    }

    public void setDated(Date dated) {
        this.dated = dated;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "receivedBms", length = 10)
    public Date getReceivedBms() {
        return receivedBms;
    }

    public void setReceivedBms(Date receivedBms) {
        this.receivedBms = receivedBms;
    }

    @Column(name = "partOfInitialPackage", nullable = false)
    public boolean getPartOfInitialPackage() {
        return partOfInitialPackage;
    }

    public void setPartOfInitialPackage(boolean partOfInitialPackage) {
        this.partOfInitialPackage = partOfInitialPackage;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "sentToPrism", length = 10)
    public Date getSentToPrism() {
        return sentToPrism;
    }

    public void setSentToPrism(Date sentToPrism) {
        this.sentToPrism = sentToPrism;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "confirmedPrism", length = 10)
    public Date getConfirmedPrism() {
        return confirmedPrism;
    }

    public void setConfirmedPrism(Date confirmedPrism) {
        this.confirmedPrism = confirmedPrism;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "sampleIfcReviewForm", length = 10)
    public Date getSampleIfcReviewForm() {
        return sampleIfcReviewForm;
    }

    public void setSampleIfcReviewForm(Date sampleIfcReviewForm) {
        this.sampleIfcReviewForm = sampleIfcReviewForm;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "sentToMoh", length = 10)
    public Date getSentToMoh() {
        return sentToMoh;
    }

    public void setSentToMoh(Date sentToMoh) {
        this.sentToMoh = sentToMoh;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "approvalMoh", length = 10)
    public Date getApprovalMoh() {
        return approvalMoh;
    }

    public void setApprovalMoh(Date approvalMoh) {
        this.approvalMoh = approvalMoh;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "traductor_id")
    public Traductor getTraductor() {
        return traductor;
    }

    public void setTraductor(Traductor traductor) {
        this.traductor = traductor;
    }

    @Column(name = "translationBudget")
    public String getTranslationBudget() {
        return translationBudget;
    }

    public void setTranslationBudget(String translationBudget) {
        this.translationBudget = translationBudget;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "sentToTranslator", length = 10)
    public Date getSentToTranslator() {
        return sentToTranslator;
    }

    public void setSentToTranslator(Date sentToTranslator) {
        this.sentToTranslator = sentToTranslator;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "translationReady", length = 10)
    public Date getTranslationReady() {
        return translationReady;
    }

    public void setTranslationReady(Date translationReady) {
        this.translationReady = translationReady;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "receivedFromTranslator", length = 10)
    public Date getReceivedFromTranslator() {
        return receivedFromTranslator;
    }

    public void setReceivedFromTranslator(Date receivedFromTranslator) {
        this.receivedFromTranslator = receivedFromTranslator;
    }

    @Column(name = "translatorRate")
    public String getTranslatorRate() {
        return translatorRate;
    }

    public void setTranslatorRate(String translatorRate) {
        this.translatorRate = translatorRate;
    }

    @Column(name = "translatorRateComments")
    public String getTranslatorRateComments() {
        return translatorRateComments;
    }

    public void setTranslatorRateComments(String translatorRateComments) {
        this.translatorRateComments = translatorRateComments;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "traductor_reviewer_id")
    public Traductor getTraductorReviewer() {
        return traductorReviewer;
    }

    public void setTraductorReviewer(Traductor traductorReviewer) {
        this.traductorReviewer = traductorReviewer;
    }

    @Column(name = "translationReviewBudget")
    public String getTranslationReviewBudget() {
        return translationReviewBudget;
    }

    public void setTranslationReviewBudget(String translationReviewBudget) {
        this.translationReviewBudget = translationReviewBudget;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "sentToTranslationReviewer", length = 10)
    public Date getSentToTranslationReviewer() {
        return sentToTranslationReviewer;
    }

    public void setSentToTranslationReviewer(Date sentToTranslationReviewer) {
        this.sentToTranslationReviewer = sentToTranslationReviewer;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "translationRevisionReady", length = 10)
    public Date getTranslationRevisionReady() {
        return translationRevisionReady;
    }

    public void setTranslationRevisionReady(Date translationRevisionReady) {
        this.translationRevisionReady = translationRevisionReady;
    }

    @Column(name = "translatorReviewRate")
    public String getTranslatorReviewRate() {
        return translatorReviewRate;
    }

    public void setTranslatorReviewRate(String translatorReviewRate) {
        this.translatorReviewRate = translatorReviewRate;
    }

    @Column(name = "translatorReviewRateComments")
    public String getTranslatorReviewRateComments() {
        return translatorReviewRateComments;
    }

    public void setTranslatorReviewRateComments(String translatorReviewRateComments) {
        this.translatorReviewRateComments = translatorReviewRateComments;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "translationCertificate", length = 10)
    public Date getTranslationCertificate() {
        return translationCertificate;
    }

    public void setTranslationCertificate(Date translationCertificate) {
        this.translationCertificate = translationCertificate;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "receivedFromTranslationReviewer", length = 10)
    public Date getReceivedFromTranslationReviewer() {
        return receivedFromTranslationReviewer;
    }

    public void setReceivedFromTranslationReviewer(Date receivedFromTranslationReviewer) {
        this.receivedFromTranslationReviewer = receivedFromTranslationReviewer;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "translationReviewForm", length = 10)
    public Date getTranslationReviewForm() {
        return translationReviewForm;
    }

    public void setTranslationReviewForm(Date translationReviewForm) {
        this.translationReviewForm = translationReviewForm;
    }




    @ManyToMany()
    @LazyCollection(LazyCollectionOption.FALSE)
    public List<ProtocoloCompromisopais> getProtocoloCompromisopaises() {
        return protocoloCompromisopaises;
    }

    public void setProtocoloCompromisopaises(List<ProtocoloCompromisopais> protocoloCompromisopaises) {
        this.protocoloCompromisopaises = protocoloCompromisopaises;
    }
}
